Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Gluon DataLoader: avoid recursionlimit error #12622

Merged
merged 6 commits into from
Sep 24, 2018
Merged

Conversation

zhreshold
Copy link
Member

@zhreshold zhreshold commented Sep 20, 2018

Description

  • Avoid RecursionError: maximum recursion depth exceeded in comparison if in some hardware the default value is smaller than or close to 1000.
  • Fixed multi_worker dataloader on windows since spawn instead of fork is used in windows by default.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

for i, (x, y) in enumerate(loader):
assert x.shape[0] == 1 and x.shape[3] == 3
assert y.asscalar() == i
sys.setrecursionlimit(old_limit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

little worried, if the test case fail after setting recursion limit to 100 but before resetting it back to old_limit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a fail is a fail, no need to care if rest tests fail right?

Copy link
Contributor

@sandeep-krishnamurthy sandeep-krishnamurthy Sep 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, you are right, I was thinking like a regular user functionality not like a unit test.

LGTM. Thanks.

@stu1130
Copy link
Contributor

stu1130 commented Sep 24, 2018

Thanks for your contribution @zhreshold
@mxnet-label-bot[pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Sep 24, 2018
@zhreshold zhreshold merged commit 54fef4a into apache:master Sep 24, 2018
@zhreshold zhreshold deleted the fork branch September 24, 2018 20:36
eric-haibin-lin pushed a commit to eric-haibin-lin/mxnet that referenced this pull request Nov 20, 2018
* avoid recursionlimit error

* add unittest

* resursion limit 100

* fix pickling void* in windows

* fix picking for windows and unittest

* explain
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants